import React, { useState } from "react";
import CodeMirror from "@uiw/react-codemirror";
import { json } from "@codemirror/lang-json";
const CustomerCodeMirror: React.FC<{ value: any; disabled: boolean; language: string }> = ({ value, disabled, language }) => {
	const [code, setCode] = useState(value);

	const onChange = (val: any, viewUpdate: any) => {
		console.log("val:", val);
		setCode(val);
	};

	return <CodeMirror value={code} width="100%" height="200px" onChange={onChange} readOnly={disabled} extensions={[json()]} />;
};
export default CustomerCodeMirror;
